<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title> API Reference Documentation
        - Module: fields</title>
    <meta name="MSSmartTagsPreventParsing" content="true" />
    <meta http-equiv="imagetoolbar" content="no" />
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <link href="css/pygments.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="page">
        <div id="header">
            <h1> API Reference</h1>
        </div>
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="formosa.html">formosa</a>
                    </li><li class="active">
                        <a href="formosa.fields.html">formosa.fields</a>
                    </li><li>
                        <a href="formosa.validators.html">formosa.validators</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Classes</h2>
                <ul>
                    <li>
                        <a href="formosa.fields.Boolean.html">Boolean</a>
                    </li><li>
                        <a href="formosa.fields.Choice.html">Choice</a>
                    </li><li>
                        <a href="formosa.fields.Date.html">Date</a>
                    </li><li>
                        <a href="formosa.fields.Decimal.html">Decimal</a>
                    </li><li>
                        <a href="formosa.fields.Email.html">Email</a>
                    </li><li>
                        <a href="formosa.fields.File.html">File</a>
                    </li><li>
                        <a href="formosa.fields.Float.html">Float</a>
                    </li><li>
                        <a href="formosa.fields.Integer.html">Integer</a>
                    </li><li>
                        <a href="formosa.fields.MultiChoice.html">MultiChoice</a>
                    </li><li>
                        <a href="formosa.fields.Password.html">Password</a>
                    </li><li>
                        <a href="formosa.fields.Phone.html">Phone</a>
                    </li><li>
                        <a href="formosa.fields.Regex.html">Regex</a>
                    </li><li>
                        <a href="formosa.fields.String.html">String</a>
                    </li><li>
                        <a href="formosa.fields.SubForm.html">SubForm</a>
                    </li><li>
                        <a href="formosa.fields.Time.html">Time</a>
                    </li><li>
                        <a href="formosa.fields.Toggle.html">Toggle</a>
                    </li><li>
                        <a href="formosa.TranslationError.html">TranslationError</a>
                    </li><li>
                        <a href="formosa.fields.ZipCode.html">ZipCode</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Module: fields</h1>
    <div class="docstring rst"><p>Translation of raw user input into validated Python values.</p>
<p>The field protocol consists of the following three methods:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">required(self)</span></tt>: Return whether a value is mandatory for the field.</li>
<li><tt class="docutils literal"><span class="pre">has_value(self,</span> <span class="pre">input)</span></tt>: Return whether a value has been provided for the
field in the given <tt class="docutils literal"><span class="pre">MultiDict</span></tt> of user input.  This method should return
true even if the input value is invalid or malformed.  In brief, it should
return whether translation will raise an exception or return a non-<tt class="docutils literal"><span class="pre">None</span></tt>
value.</li>
<li><tt class="docutils literal"><span class="pre">translate(self,</span> <span class="pre">input)</span></tt>: Transform a subset of a <tt class="docutils literal"><span class="pre">MultiDict</span></tt> into an
atomic Python value, or raise either <tt class="docutils literal"><span class="pre">TranslationError</span></tt> or <tt class="docutils literal"><span class="pre">ErrorSet</span></tt> if
input is malformed.</li>
</ul>
<p>For fields that expect only one parameter, only the value with the final
matching key in the <tt class="docutils literal"><span class="pre">MultiDict</span></tt> of input is used, unless otherwise noted.</p>
</div>
    <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
</ul>
    <div>
        <h2>Classes</h2>
            <h3>
                <a href="formosa.fields.Boolean.html">Boolean</a>
            </h3>
            <div class="docstring rst"><p>Field for truth values following a three-valued logic (i.e. true,
false, and unknown or not applicable); in brief, a nullable boolean.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Boolean.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Choice.html">Choice</a>
            </h3>
            <div class="docstring rst"><p>Field for choosing an item from a set of options.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Choice.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Date.html">Date</a>
            </h3>
            <div class="docstring rst"><p>Field for dates.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Date.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Decimal.html">Decimal</a>
            </h3>
            <div class="docstring rst"><p>Field for arbitrary precision numbers, implemented using the
<tt class="docutils literal"><span class="pre">decimal</span></tt> module from the standard library.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Decimal.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Email.html">Email</a>
            </h3>
            <div class="docstring rst"><p>A field for e-mail addresses.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Email.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.File.html">File</a>
            </h3>
            <div class="docstring rst"><p>Field for uploaded files.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.File.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Float.html">Float</a>
            </h3>
            <div class="docstring rst"><p>Field to hold floating-point values.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Float.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Integer.html">Integer</a>
            </h3>
            <div class="docstring rst"><p>Field to hold integer values.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Integer.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.MultiChoice.html">MultiChoice</a>
            </h3>
            <div class="docstring rst"><p>Field for multiple choices from among a set of strings.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.MultiChoice.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Password.html">Password</a>
            </h3>
            <div class="docstring rst"><p>Field for passwords.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Password.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Phone.html">Phone</a>
            </h3>
            <div class="docstring rst"><p>Field for United States telephone numbers.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Phone.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Regex.html">Regex</a>
            </h3>
            <div class="docstring rst"><p>A field that is validated by a specifiable regular expression, and
otherwise treated as a string.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Regex.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.String.html">String</a>
            </h3>
            <div class="docstring rst"><p>Field for strings.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.String.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.SubForm.html">SubForm</a>
            </h3>
            <div class="docstring rst"><p>Container for a set of fields to be treated together as a single field.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.SubForm.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Time.html">Time</a>
            </h3>
            <div class="docstring rst"><p>Field for times on a 12-hour clock.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Time.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.Toggle.html">Toggle</a>
            </h3>
            <div class="docstring rst"><p>Field that has two states, either on or off.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.Toggle.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.TranslationError.html">TranslationError</a>
            </h3>
            <div class="docstring rst"><p>Exception for when translation of a field fails.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.TranslationError.html">Details</a>
    </li>
</ul>
            <h3>
                <a href="formosa.fields.ZipCode.html">ZipCode</a>
            </h3>
            <div class="docstring rst"><p>Field for United States postal codes.</p></div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li>
        <a href="formosa.fields.ZipCode.html">Details</a>
    </li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.2</a> on 2008-11-26 11:09
        </div>
    </div>
</body>
</html>